package com.starlz.jpa.service.impl;

import com.starlz.jpa.dao.EmpDao;
import com.starlz.jpa.entity.EmDe;
import com.starlz.jpa.entity.Emp;
import com.starlz.jpa.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description:
 * @Author: wangzi
 * @Date: 2018/11/12 11:27
 */
@Service("empService")
public class EmpserviceImpl implements EmpService {

    @Autowired
    private EmpDao empDao;

    @Override
    public List<Emp> findAll() {

        return empDao.findAll(PageRequest.of(0,10,new Sort(Sort.Direction.DESC,"id")));
    }

}
